﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace RMS
{
    public static class ReflectionExtention
    {
        public static object GetPropertyValue(this Type propertyType, string propertyName, object classObject)
        {
            return propertyType.GetProperty(propertyName).GetValue(classObject, null);
        }
        public static TResult GetPropertyValue<TResult>(this Type propertyType, string propertyName, object classObject)
        {
            return (TResult)propertyType.GetProperty(propertyName).GetValue(classObject, null);
        }
        public static void SetPropertyValue<TValue>(this Type propertyType, string propertyName, object classObject, TValue value)
        {
            propertyType.GetProperty(propertyName).SetValue(classObject, value, null);
        }

    }
}
